package com.lynn.boot.rabbitmqconsumer.listener;

import org.springframework.amqp.rabbit.annotation.RabbitHandler;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.stereotype.Component;

import java.util.Map;

/**
 * @Description:
 * @Date: 2019-11-13 17:10
 * @Auther: lynn
 */
@Component
public class FanoutReceiver {

    @RabbitHandler
    @RabbitListener(queues = "fanout.A")
    public void fanoutReceiverA(Map testMessage) {
        System.out.println("FanoutReceiverA消费者收到消息  : " + testMessage.toString());
    }


    @RabbitHandler
    @RabbitListener(queues = "fanout.B")
    public void fanoutReceiverB(Map testMessage) {
        System.err.println("FanoutReceiverB消费者收到消息  : " + testMessage.toString());
    }


    @RabbitHandler
    @RabbitListener(queues = "fanout.C")
    public void fanoutReceiverC(Map testMessage) {
        System.out.println("FanoutReceiverC消费者收到消息  : " + testMessage.toString());
    }

}
